/*
 * @lc app=leetcode.cn id=575 lang=javascript
 *
 * [575] 分糖果
 */

// @lc code=start
/**
 * @param {number[]} candyType
 * @return {number}
 */
 var distributeCandies = function(candyType) {
    let half = candyType.length / 2
    const filter = new Set(candyType)
    if (filter.size > half) {
        return half
    } else {
        return filter.size
    }
};
// @lc code=end

